const users = wx.cloud.database().collection("users")
var app=getApp()
var tansuobi=0
Page({
  data: {
    userid:'',
    tansuobi:'0个碳索币'
  },
  fanhui:function(){
    wx.navigateBack({})
  },
  onLoad:function(){
    var that=this
    users.where({
      _openid: app.globalData.openid
    }).get({
      success(res){
        var userid=res.data[0].name
        tansuobi=res.data[0].tansuo+'个碳索币'
        console.log(tansuobi)
        that.setData({
          userid:userid,
          tansuobi:tansuobi
        })
      }
    })
  },
  a:function(){
    if (tansuobi>=10){
      wx.showModal({
        title: '提示',
        content: '本次提现验证码为'+yanzhengma+'，已自动为您复制，发送给客服即可',
        showCancel:false,
        confirmText:'确定',
        success (res) {
          if (res.confirm) {
            wx.setClipboardData({
              data: 'data',
            })
          }
        }
      })
    }else{
      wx.showModal({
        title: '提示',
        content: '碳索币不足',
        showCancel:false,
        confirmText:'确定',
      })
    }
  },
  b:function(){
    if (tansuobi>=10){

    }else{
      wx.showModal({
        title: '提示',
        content: '碳索币不足',
        showCancel:false,
        confirmText:'确定',
      })
    }
  },
  c:function(){
    if (tansuobi>=10){

    }else{
      wx.showModal({
        title: '提示',
        content: '碳索币不足',
        showCancel:false,
        confirmText:'确定',
      })
    }
  },
  d:function(){
    if (tansuobi>=10){

    }else{
      wx.showModal({
        title: '提示',
        content: '碳索币不足',
        showCancel:false,
        confirmText:'确定',
      })
    }
  },
})